<template>
  <div class="lynx-main lynx-info">
    <BaseDescriptions :columns="infoColumns" :info="info" />
  </div>
</template>

<script lang="ts" setup>
import BaseDescriptions from '@/components/base/baseDescriptions.vue';

import { ElMessage } from 'element-plus';
import { ref, reactive, watch } from 'vue';
import { base, ${dv}, infoColumns } from '../ts/main';

const emit = defineEmits(['success']);
const props = defineProps(['idVal']);
const info = reactive<${dv}>(new ${dv});

const updateData = (idVal: string) => {
  base.baseApi.info(idVal).then(res => {
    if (res.isSuccess) {
      Object.assign(info, res.data);
    } else {
      ElMessage.error(res.message);
    }
  });
}

watch(() => props.idVal, updateData, { immediate: true });
</script>

<style lang="scss" scoped></style>